package com.zzj.hotel.core.utils;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class AjaxUtil {
	public static void renderData(HttpServletResponse response, String data) {
		PrintWriter printWriter = null;
		try {
			response.setCharacterEncoding("UTF-8"); //设置编码格式
			response.setContentType("text/html");   //设置数据格式
			printWriter = response.getWriter();
			printWriter.print(data);
		} catch (IOException ex) {
			ex.printStackTrace();
		} finally {
			if (null != printWriter) {
				printWriter.flush();
				printWriter.close();
			}
		}
	}

}
